<?php

#    Document   : editprofile
#    Created on : May 9, 2011, 6:46:49 PM
#    Author     : ClarkT AKA FalleN
#    Company    : Amodity
#    Web        : http://www.amodity.com
#    Copyright  : 2011

echo form_open('admin/users/edit_user', array('class' => 'form'));
echo form_hidden('id', $row->id);
echo form_label($this->lang->line('admin_first_name'), 'firstname');
echo form_input(array(
    'name' => 'firstname',
    'class' => 'editfield',
    'value' => $row->first_name
));
echo form_label($this->lang->line('admin_last_name'), 'lastname');
echo form_input(array(
    'name' => 'lastname',
    'class' => 'editfield',
    'value' => $row->last_name
));
echo form_label($this->lang->line('admin_username'), 'username');
echo form_input(array(
    'name' => 'username',
    'class' => 'editfield',
    'value' => $row->username
));
echo form_label($this->lang->line('admin_email'), 'email');
echo form_input(array(
    'name' => 'email',
    'class' => 'editfield',
    'value' => $row->email
));
echo form_label($this->lang->line('admin_access'), 'access');
$this->load->library('auth');
$permissions = $this->auth->get_groups();
$groups = array();
foreach ($permissions as $perms) {
    $groups[$perms->id] = $perms->name;
}

echo form_dropdown('access', $groups, $row->group_id);
echo '<br /><br />';
echo form_label($this->lang->line('admin_active'), 'active');
if ($row->active == 1) {
    echo form_checkbox(array(
        'name' => 'active',
        'class' => 'editfield checkbox',
        'value' => $row->active,
        'checked' => TRUE
    ));
} else {
    echo form_checkbox(array(
        'name' => 'active',
        'class' => 'editfield',
        'value' => $row->active,
        'checked' => FALSE
    ));
}
echo '<br /><br />';

echo form_button(array('name' => 'submit', 'value' => $this->lang->line('g_submit'), 'type' => 'submit', 'class' => 'green', 'content' => $this->lang->line('g_submit')));
echo form_close();

echo form_open('admin/change_password', array('class' => 'form'));
echo form_fieldset('<a href="#">' . $this->lang->line('admin_change_password') . '</a>', array('class' => 'grey collapsed no-margin'));
echo '<p>';
echo form_label($this->lang->line('cp_old_pass'), 'old');
echo form_password(array(
    'name' => 'old',
    'id' => 'old',
    'class' => 'editfield',
));
echo form_label($this->lang->line('cp_new_pass'), 'new');
echo form_password(array(
    'name' => 'new',
    'id' => 'new',
    'class' => 'editfield',
));

echo form_label($this->lang->line('cp_new_pass_confirm'), 'new_confirm');
echo form_password(array(
    'name' => 'new_confirm',
    'id' => 'new_confirm',
    'class' => 'editfield',
));



echo form_hidden($this->session->userdata('user_id'));
echo form_button(array('id' => 'forgotpass', 'class' => 'small fr', 'type' => 'submit'), $this->lang->line('g_send'));
echo '</p>';
echo form_fieldset_close();
echo form_close();
?>